<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                    template="./AdminTemplate.xhtml">
        <ui:define name="Title">
            <title>Add Order</title>
        </ui:define>
        <ui:define name="content">
            <h:form>
                <div id="contenner" style="text-align: center;margin-top: 50px">
                    <!--                    <p:panel id="p1" rendered="{adminVihicleBean.emp.position==1}" header="Add Order" footer="order">-->

                    <h:panelGrid rendered="#{adminVihicleBean.emp.position==1}">
                        <h:column>
                            <h1>Add Order </h1>
                            <div id="content" style="margin: 10px auto;width: 700px">
                                <table id="tblCusInfo">
                                    <tr>
                                        <td>
                                            <h4 style="width: 160px; color: #191919" >Full Name :<strong style="color: red">*</strong> </h4>
                                        </td>
                                        <td>
                                            <p:inputText  id="fullname" value="#{carBean.ors.cusFullName}" style="width: 250px" required="true" requiredMessage="Please insert customer's name">
                                                <f:validateLength for="fullname" minimum="5" />
                                                <f:validator validatorId="checkvalidname"/>
                                            </p:inputText>
                                        </td>
                                        <td>
                                            <p:message for="fullname"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <h4 style="width: 160px; color: #191919" >Address :<strong style="color: red">*</strong> </h4>
                                        </td>
                                        <td>
                                            <p:inputText  id="address" value="#{carBean.ors.address}" style="width: 250px" required="true" requiredMessage="Please insert customer's address">
                                                <f:validateLength for="address" minimum="5" />
                                            </p:inputText>
                                        </td>
                                        <td>
                                            <p:message  for="address" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <h4 style="width: 160px; color: #191919" >Phone Number :<strong style="color: red">*</strong> </h4>
                                        </td>
                                        <td>
                                            <p:inputText  id="phone" value="#{carBean.ors.phoneNumber}" style="width: 250px" required="true" requiredMessage="Please insert customer's phome">
                                                <f:validator validatorId="checkvalidphone"/>
                                            </p:inputText>
                                        </td>
                                        <td>
                                            <p:message for="phone"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <h4 style="width: 160px; color: #191919" >Email :<strong style="color: red">*</strong> </h4>
                                        </td>
                                        <td>
                                            <p:inputText  id="email" value="#{carBean.ors.email}" style="width: 250px" required="true" requiredMessage="Please insert customer's Email">
                                                <f:validator validatorId="checkvalidemail"/>
                                            </p:inputText>
                                        </td>
                                        <td>
                                            <p:message for="email"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <h4 style="width: 160px; color: #191919" >Comment :</h4>
                                        </td>
                                        <td>
                                            <p:inputTextarea  id="comment" value="#{carBean.ors.comments}" style="width: 250px"/>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>

                                        </td>
                                        <td>
                                            <p:inputText value="#{carBean.vehi.vehilceName}" style="width: 250px" disabled="true" required="true"/>
                                        </td>
                                        <td>
                                            <p:commandButton id="btnaddOrder" value="Choice Vehicle" />
                                            <p:overlayPanel id="carPanel" for="btnaddOrder" hideEffect="fade" dynamic="true">

                                                <p:dataTable id="table" var="vehicle" value="#{carBean.listvehicle}" rows="6" paginator="true">
                                                    <p:column headerText="Vehicle Name">
                                                        <h:outputText value="#{vehicle.vehilceName}" />
                                                    </p:column>

                                                    <p:column headerText="Price">
                                                        <h:outputText value="#{vehicle.price}" />
                                                    </p:column>

                                                    <p:column headerText="Manufacturer">
                                                        <h:outputText value="#{vehicle.cylinder}" />
                                                    </p:column>

                                                    <p:column headerText="Color">
                                                        <h:outputText value="#{vehicle.color}" />
                                                    </p:column>
                                                    <p:column headerText="Color">
                                                        <h:commandButton value="choice" action="#{carBean.choiceVehicle(vehicle)}" />
                                                    </p:column>
                                                </p:dataTable>
                                            </p:overlayPanel>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>

                                        </td>
                                        <td>
                                            <h:commandButton disabled="#{carBean.submitPayment}" action="#{carBean.paymentAdmin}" value="SUBMIT" style="width: 120px; height: 50px; font-size: 1.5em;font-weight: bold;" />

                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                </table>
                                
                            </div>
                        </h:column>
                    </h:panelGrid>

                    <!--                    </p:panel>-->
                    <p:panel id="p1" rendered="#{adminVihicleBean.emp.position!=1}" header="Sorry" footer="sorry">
                        Sorry Ban khong co quyen vao trang nay
                        <a href="login.xhtml">Home</a>
                    </p:panel>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>
</html>
